package com.xiaolin.structure.Test;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;

import javax.xml.rpc.ParameterMode;

/**
 * @ClassName Test
 * @Description 描述
 * @Detail detail
 * @Author MyPC
 * @Date 2020/12/18
 * @Version 1.0
 */
public class Test {
    public static void main(String[] args) {
        Service service = new Service();
        Call call = null;
        try {
            call = (Call) service.createCall();
            call.setTargetEndpointAddress(new java.net.URL("http://127.0.0.1:9090/wcm/services/trswcm:WCMTESTService")); //Service地址及名称
            call.setOperationName("CA_UpdateForSame");
            call.addParameter("xmlStr", XMLType.XSD_STRING, ParameterMode.IN);
            call.addParameter("systemId", XMLType.XSD_STRING, ParameterMode.IN);
            call.setReturnType(XMLType.XSD_INT);
            Object invoke = call.invoke(new Object[]{
                    "<task>\n" +
                            "\t<user>\n" +
                            "\t\t<oper>mod</oper>\n" +
                            "\t\t<!--操作类型（增加用户）-->\n" +
                            "\t\t<id>14000001@gd.zg</id>\n" +
                            "\t\t<!--用户信任号-->\n" +
                            "\t\t<name>王五</name>\n" +
                            "\t\t<!--用户姓名-->\n" +
                            "\t\t<usertype/>\n" +
                            "\t\t<!--用户类型UT01：个人证书用户，UT02：法人证书用户-->\n" +
                            "<grade>秘密</grade>\n" +
                            "<!--用户密级-->\n" +
                            "\t\t<dname>办la处</dname>\n" +
                            "\t\t<!--用户所属机构名称-->\n" +
                            "\t\t<did>34000081@gd.zg</did>\n" +
                            "\t\t<!--用户所属机构标识-->\n" +
                            "\t\t<dorder/>\n" +
                            "\t\t<!--用户排序号-->\n" +
                            "\t\t<dcode/>\n" +
                            "\t\t<!--用户所属机构编码-->\n" +
                            "\t\t<sexual>1</sexual>\n" +
                            "\t\t<!--用户性别1:男，0：女-->\n" +
                            "\t\t<duty/>\n" +
                            "\t\t<!--用户职务-->\n" +
                            "\t\t<post/>\n" +
                            "\t\t<!--用户岗位-->\n" +
                            "\t\t<account/>\n" +
                            "\t\t<!--用户账号-->\n" +
                            "\t\t<password/>\n" +
                            "\t\t<!--用户密码-->\n" +
                            "\t\t<mail/>\n" +
                            "\t\t<!--安全邮箱-->\n" +
                            "\t</user>\n" +
                            "</task>", "91300996@sz.gd.cp"});//Object成员为调用该Service方法中需要的参数
                System.out.println("==========sResult========\n" + invoke);
        } catch (Exception e) {
        e.printStackTrace();
    }
    }
}
